package com.burgeon.backend.SHOPBACKEND.mappers;



import com.burgeon.backend.SHOPBACKEND.entity.*;

import java.util.ArrayList;
import java.util.List;

public interface MaterialMapper {
    //新增素材分组
    Integer insertMaterialGroup(MaterialGroup materialGroup);
    Integer upGroup(String id,String groupImg);

    //查看所有分组
    ArrayList<MaterialGroup> findGroupByAccount(String account);
    String findGroupCount(String account);

   // findAnGroupByAccount
   ArrayList<MaterialGroup> findAnGroupByAccount(String account);

    //
    MaterialGroup fGroupNameByGpId(String account, String groupId);

    //删除分组
    Integer deGroupById(String id, String account);

    //修改分组
    Integer upGroupName(String id, String groupName,String groupImg);

    //搜索分组
    ArrayList<MaterialGroup> findGroupByName(String account,String groupName);
    String findGroupCountByName(String account,String groupName);

    //findAnGroupByName
    ArrayList<MaterialGroup> findAnGroupByName(String account,String groupName);

    /**=============================素材===================================*/
    //新增素材
    Integer insertMaterial(Material material);

    //删除素材
    Integer deMaterialByGroupId(String groupId);

    Integer deMaterialById(String id);

    //根据分组id查询素材
    ArrayList<Material> findMaByGpId(String groupId);

    //根据id修改素材
    Integer upMaterial(String materialName,String groupId,String imgDescribe,String id,String price);

    //根据id查看素材
    Material findMaterialById(String id);

    //查看所有素材
    ArrayList<Material> findMaterialAll(String account,int start);
    String findMaterialCountAll(String account);

    //findAnMaterialAll
    ArrayList<Material> findAnMaterialAll(String account);

    //产看分组的素材
    ArrayList<Material> findMaterialBiGid(String account,String groupId);

    //搜索
    ArrayList<Material> findMaterialByName(String account,String materialName);

    //获取的总条数
    String findMaterialCountByName(String account,String materialName,String groupId);

    //后台搜索
   //findWebMaterialByName
    ArrayList<Material> findWebMaterialByName(String account,String materialName,int start,String groupId);

    /**==============================素材图片===================================*/
    Integer findMaImgCountByMId(String mid);

    Integer insertMaterialImgs(String mid, String img);

    //删除素材图片
    Integer deMaterialImgs(String mid);

    //根据素材id查询素材图片id
    ArrayList<MaterialImgs> findMaImgsByGpId(String mid);

    //根据素材获取素材图片
    ArrayList<MaterialImgs>findImgsByMId(String mid);

    Integer deMateriaImglById(String id);

    /**==============================素材连接==================================*/
    Integer addMaterialLink(String miid, String gid);

    //删除素材连接
    Integer deMaterialLink(String miid);

    //根据素材图片id删除素材链接
    ArrayList<MaterialLink> findMaLinkByMiid(String miid);

    //根据id查看连接
    MaterialLink findMaLinkById(String id);

    //根据素材图片id修改链接
    Integer upMaLinkByMid(String mid, String gid);

    /**===============================素材商品=======================================*/
    MaterialGoods getGoodsById(String id);


}
